local U = require "packages/utility/utility"
local zifu = fk.CreateSkill{
    name = "ym1__zifu",
}
Fk:loadTranslationTable{
    ["ym1__zifu"] = "自缚",
    [":ym1__zifu"] = "出牌阶段，你可以令本回合手牌上限-1并蓄谋牌堆一端的牌。",
    ["#ym1__zifu"] = "自缚：令本回合手牌上限-1并蓄谋牌堆一端的牌",

    ["$ym1__zifu1"] = "澄汰王室，迎立宗子！",
    ["$ym1__zifu2"] = "僣孽为害，吾岂可谋而不行？",
}
zifu:addEffect("active",{
    anim_type = "drawcard",
    card_num = 0,
    target_num = 0,
    prompt = "#ym1__zifu",
    can_use = function(self, player)
        return player:hasSkill(self) and player:getMaxCards() > 0
    end,
    card_filter = Util.FalseFunc,
    interaction = function(self)
        return UI.ComboBox {choices = {"Top", "Bottom"}}
    end,
    on_use = function(self, room, effect)
        local player = room:getPlayerById(effect.from.id)
        local choice = self.interaction.data
        local card = room:getNCards(1, choice == "Top" and "top" or "bottom")[1]
        U.premeditate (player, card, self.name, player)
        if player.dead then return end
        room:addPlayerMark(player, MarkEnum.MinusMaxCardsInTurn, 1)
    end,
})
return zifu